#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>

int main(int argc, char** argv)
{
	pid_t pid;
	int fd;
	
	pid = fork();
	if(pid > 0)
	exit(0);

	setsid();

	chdir("/home/ubuntu");

	umask(0022);

	close(0);//STDIN_FILENO
	
	fd = open("/dev/null" , O_RDWR);

	dup2(fd, STDOUT_FILENO);
	dup2(fd, STDERR_FILENO);
	
	while(1);

	return 0;
}
